package 笔试真题;

// 24 = 3 * 2 * 2 * 2
// 24 1,2,3,4,6,8,12,24  2*4

import java.util.Arrays;
import java.util.Scanner;

// 72 = 3 * 3 * 2 * 2 * 2
// 72 1,2,3,4,6,8,9,12,18,24,36,72
public class Tengxun22 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] aList = new int[n];
        int[] bList = new int[n];
        for (int i = 0; i < n; i++) {
            aList[i] = getNum(scanner.nextInt());
        }
        for (int i = 0; i < n; i++) {
            bList[i] = getNum(scanner.nextInt());
        }
        Arrays.sort(aList);
        Arrays.sort(bList);
        int b = 0;
        int ans =0;
        for (int i = 0; i< aList.length; i++) {
            while (b != aList.length-1 && aList[i]<=bList[b]){
               b++;
            }
            if(aList[i]>bList[b]) ans ++;
        }
        System.out.print(ans);
    }

    public static int getNum(int m){
        int[] nums = new int[m / 2+1];
        while (m != 1 ) {
            for (int i = 2; i <= nums.length; i++) {
                if(i == nums.length) {
                    int ans =1;
                    for (int num : nums) {
                        if(num!=0){
                            ans *= (num+1);
                        }
                    }
                    return ans ==1 ? 2 : ans;
                }
                if (m % i == 0) {
                    m /= i ;
                    nums[i]++;
                    break;
                }
            }
        }
        int ans =1;
        for (int num : nums) {
            if(num!=0){
                ans *= (num+1);
            }
        }
        return ans;
    }
}
